﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using Jumbot.DataOper.UI;
using Jumbot.DataOper;
using JumbotCms.Common;
namespace JumbotCms.WebFile.Admin
{
    public partial class _mail_send : JumbotCms.API.AdminCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin_Load("0000", "html");
            this.txtBody.BasePath = site.Dir + "editors/114editor/";
            if (q("act") == "save")
            {
                Response.Clear();
                string _ToMailList = f("txtToMailList");
                string _Title = f("txtTitle");
                string _Body = f("txtBody");
                int _success = 0;
                if (_ToMailList.Length == 0)
                {
                    Response.Write("top.JumbotCms.Alert('收件人错误', '0');");
                    Response.End();
                }
                if (_Title.Length == 0)
                {
                    Response.Write("top.JumbotCms.Alert('标题错误', '0');");
                    Response.End();
                }
                if (_Body.Length == 0)
                {
                    Response.Write("top.JumbotCms.Alert('内容错误', '0');");
                    Response.End();
                }
                string[] _tomail = _ToMailList.Split(',');
                for (int i = 0; i < _tomail.Length; i++)
                {
                    if (SendMail(_tomail[i], _Title, _Body))
                        _success++;
                }
                Response.Write("JumbotCms.Alert('" + _success + "封邮件发送成功', '1')");
            }
        }
    }
}
